package com.rainbow.bam.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * 菜单实体类
 * 
 * @author zhaolei
 * @version $Id: HtSource.java, v 0.1 2015年11月19日 下午5:31:57 zhaolei Exp $
 */
@Entity
@Table(name = "ht_source")
@NamedQuery(name = "HtSource.findAll", query = "SELECT c FROM HtSource c")
public class HtSource implements java.io.Serializable {

    /**
     *UUID
     */
    private static final long serialVersionUID = -5175246456181078279L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(generator = "identity")
    @GenericGenerator(name = "identity", strategy = "identity")
    @Column(unique = true, nullable = false, name = "source_id")
    private Long              id;

    /**
     * 菜单名称
     */
    @Column(name = "source_name")
    private String           name;
    /**
     * 菜单地址
     */
    @Column(name = "source_code")
    private String           sourceCode;
    /**
     * 菜单级别
     */
    @Column(name = "source_level")
    private Integer          level;
    /**
     * 菜单排序
     */
    @Column(name = "source_style")
    private String           style;
    /**
     * 关联权限方法
     */
    @OneToMany
    @JoinColumn(name = "source_id")
    private Set<HtSrcAction> htSrcActions;
    /**
     * 
     */
    @Column
    private int              position;

    /**
     * 是否为菜单
     */
    @Column(name = "is_menu")
    private int      isMenu;
    /**
     * 状态
     */
    @Column
    private String   status;
    /**
     * 父级菜单ID
     */
    @ManyToOne
    @JoinColumn(name = "parent_id")
    private HtSource parent;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * 描述
     */
    @Column
    private String description;
    /**
     * 图标
     */
    @Column
    private String icon;

    public int getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(int isMenu) {
        this.isMenu = isMenu;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    /** default constructor */
    public HtSource() {
    }

    public String getSourceCode() {
        return this.sourceCode;
    }

    public void setSourceCode(String sourceCode) {
        this.sourceCode = sourceCode;
    }

    public Set<HtSrcAction> getHtSrcActions() {
        return htSrcActions;
    }

    public void setHtSrcActions(Set<HtSrcAction> htSrcActions) {
        this.htSrcActions = htSrcActions;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public HtSource getParent() {
        return parent;
    }

    public void setParent(HtSource parent) {
        this.parent = parent;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    @Transient
    private String nodeLabel;
    @Transient
    String         classStyle;
    @Transient
    String         imagePath;
    @Transient
    String         target;
    @Transient
    boolean        isContainChild;
    @Transient
    boolean        isLastChild;
    @Transient
    String         link;
    @Transient
    String         title;
    @Transient
    boolean        isEdit;
    @Transient
    String         alt;
    @Transient
    HtSource       nextNode;
    @Transient
    private String menuUrl;

    public String getNodeLabel() {
        return nodeLabel;
    }

    public void setNodeLabel(String nodeLabel) {
        this.nodeLabel = nodeLabel;
    }

    public String getClassStyle() {
        return classStyle;
    }

    public void setClassStyle(String classStyle) {
        this.classStyle = classStyle;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public boolean isContainChild() {
        return isContainChild;
    }

    public void setContainChild(boolean isContainChild) {
        this.isContainChild = isContainChild;
    }

    public boolean isLastChild() {
        return isLastChild;
    }

    public void setLastChild(boolean isLastChild) {
        this.isLastChild = isLastChild;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isEdit() {
        return isEdit;
    }

    public void setEdit(boolean isEdit) {
        this.isEdit = isEdit;
    }

    public String getAlt() {
        return alt;
    }

    public void setAlt(String alt) {
        this.alt = alt;
    }

    public HtSource getNextNode() {
        return nextNode;
    }

    public void setNextNode(HtSource nextNode) {
        this.nextNode = nextNode;
    }

    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

}
